package com.example.runlian.service.impl;

import com.example.runlian.mapper.PictureMapper;
import com.example.runlian.pojo.PageInfo;
import com.example.runlian.pojo.Picture;
import com.example.runlian.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 图片逻辑处理 实现
 */
@Service
public class PictureServiceImpl implements PictureService
{
    @Autowired
    private PictureMapper pictureMapper;


    @Override
    public List<Picture> queryPictureByMid(Integer mid) {
        return pictureMapper.queryPictureByMid(mid);
    }


    @Override
    public List<Picture> queryPictureByPage(PageInfo pageInfo) {
        return pictureMapper.queryPictureByPage(pageInfo);
    }

    @Override
    public Integer updatePicture(Picture picture) {
        return pictureMapper.updatePicture(picture);
    }

    @Override
    public Integer queryPictureNum() {
        return pictureMapper.queryPictureNum();
    }

    @Override
    public Integer addPicture(Picture picture) {
        return pictureMapper.addPicture(picture);
    }

    @Override
    public Integer deletePicture(Integer pid) {
        return pictureMapper.deletePictureByPid(pid);
    }

    @Override
    public Integer queryMaxPicturePid() {
        return pictureMapper.queryMaxPictureNum();
    }


}
